import { postRequest, getRequest } from '/@/lib/axios';

export const pdfApi = {
  // 上传PDF文档
  upload: (file, userId) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('userId', userId);
    return postRequest('/pdf/document/upload', formData, {
      headers: { 'Content-Type': 'multipart/form-data' },
    });
  },

  // 搜索PDF文档内容
  search: (keyword) => {
    return getRequest('/pdf/document/search', { keyword });
  },

  // 检查OCR配置状态
  checkOcrConfig: () => {
    return getRequest('/pdf/document/ocr/check');
  },

  // 获取OCR配置信息
  getOcrConfig: () => {
    return getRequest('/pdf/document/ocr/config');
  },
}; 